package com.dinree.api;


import com.base.library.http.HttpResult;
import com.dinree.bean.OrderBean;
import com.dinree.bean.UserBean;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface ApiService {

    @FormUrlEncoded
    @POST("epsea/public/api/login/smsReq")
    Observable<HttpResult<UserBean>> register(@Field("type") String type, @Field("phone") String phone, @Field("password") String pwd, @Field("use_captcha") String code);

    @FormUrlEncoded
    @POST("epsea/public/api/login/third_login")
    Observable<HttpResult<UserBean>> third_login(@Field("nickname") String nickname, @Field("openid") String openid, @Field("gender") String gender, @Field("avatar") String avatar);

    @FormUrlEncoded
    @POST("epsea/public/api/login/phoneLogin")
    Observable<HttpResult<UserBean>> login(@Field("phone") String phone, @Field("password") String code);

    @FormUrlEncoded
    @POST("epsea/public/api/user/logout")
    Observable<HttpResult<String>> logout(@Field("user_id") String user_id, @Field("user_token") String user_token);

    @FormUrlEncoded
    @POST("epsea/public/api/user/get_dealer_state")
    Observable<HttpResult<OrderBean>> get_dealer_state(@Field("user_id") String user_id, @Field("user_token") String user_token);

    @FormUrlEncoded
    @POST("epsea/public/api/user/get_basic_info")
    Observable<HttpResult<UserBean>> get_basic_info(@Field("user_id") String user_id, @Field("user_token") String user_token);

    @FormUrlEncoded
    @POST("epsea/public/api/Personal/countorder")
    Observable<HttpResult<OrderBean>> wait_comment(@Field("user_id") String user_id, @Field("user_token") String user_token);

    /**
     * 修改手机号
     *
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/other/change_phone")
    Observable<HttpResult<String>> change_phone(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("phone") String phone,
                                                @Field("use_captcha") String use_captcha);

    /**
     * 密码验证
     *
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/other/verify_password")
    Observable<HttpResult<String>> verify_password(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("password") String password);

    /**
     * 验证旧手机
     * @param user_id
     * @param user_token
     * @param password
     * @param use_captcha
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/other/verify_old_phone")
    Observable<HttpResult<String>> verify_old_phone(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("phone") String password, @Field("use_captcha") String use_captcha);

    /**
     * 密码设置
     *
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/other/pw_set")
    Observable<HttpResult<String>> pw_set(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("phone") String phone,
                                          @Field("use_captcha") String use_captcha,
                                          @Field("password") String password);

    /**
     * 经销商认证
     *
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/user/dealer_verify")
    Observable<HttpResult<String>> dealer_verify(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("name") String name,
                                                 @Field("corpname") String corpname,
                                                 @Field("corp_address") String corp_address,
                                                 @Field("corp_license") String corp_license);

    /**
     * 保存个人信息
     *
     * @param nickname
     * @param avatar
     * @param mobile
     * @param email
     * @param gender
     * @param district
     * @param birthday
     * @param name
     * @param corpname
     * @param corp_address
     * @param corp_license
     * @param referee_name
     * @param referee_mobile
     * @param referee_corpname
     * @param referee_corpaddress
     * @return
     */
    @FormUrlEncoded
    @POST("epsea/public/api/user/save_basic_info")
    Observable<HttpResult<String>> saveBasicInfo(@Field("user_id") String user_id, @Field("user_token") String user_token, @Field("nickname") String nickname,
                                                 @Field("avatar") String avatar,
                                                 @Field("mobile") String mobile,
                                                 @Field("email") String email,
                                                 @Field("gender") String gender,
                                                 @Field("district") String district,
                                                 @Field("birthday") String birthday,
                                                 @Field("name") String name,
                                                 @Field("corpname") String corpname,
                                                 @Field("corp_address") String corp_address,
                                                 @Field("corp_license") String corp_license,
                                                 @Field("referee_name") String referee_name,
                                                 @Field("referee_mobile") String referee_mobile,
                                                 @Field("referee_corpname") String referee_corpname,
                                                 @Field("referee_corpaddress") String referee_corpaddress);

}